﻿@*@model EasyLift.TMS.Web.Helpers.PaginatedList<EasyLift.TMS.Web.Models.Driver>*@

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


    <div id="ActionLinkButtons">
        @Html.ActionLink("Create New " , "Create") 
    </div>

    <script type="text/javascript">
        jQuery(document).ready(function () {
            $("#list").jqGrid({
                url: '/Driver/GridData',
                width: 720,
                height: 250,
                datatype: 'json',
                mtype: 'GET',
                colNames: ['Civil ID', 'First Name', 'Last Name', 'Arabic First Name', 'Country ', 'Passport No', 'Driver Mission Status'],
                colModel: [
                        { name: 'CivilID', index: 'CivilID', width: 140, align: 'left', hidden: false, search: true, searchoptions: { sopt: ['cn'] }, formatter: EditLinkFormatter },
                        { name: 'FirstName', index: 'FirstName', width: 140, align: 'left', hidden: false, search: true, searchoptions: { sopt: ['cn'] }, formatter: EditLinkFormatter },
                        { name: 'LastName', index: 'LastName', width: 240, align: 'left', search: false },
                        { name: 'ArabicFirstName', index: 'ArabicFirstName', width: 240, align: 'left', search: true, searchoptions: { sopt: ['cn']} },
                        { name: 'CountryCode', index: 'CountryCode', width: 240, align: 'left', search: true, searchoptions: { sopt: ['cn']} },
                        { name: 'PassportNo', index: 'PassportNo', width: 240, align: 'left', search: true, searchoptions: { sopt: ['cn']} },
                        { name: 'DriverMissionStatus', index: 'DriverMissionStatus', width: 140, align: 'left', search: false}],
                pager: '#pager',
                rowNum: 10,
                rowList: [10, 20, 50],
                shrinkToFit: false,
                sortname: 'CivilID',
                sortorder: "DESC",
                viewrecoreds: false,
                rownumbers: true,
                hidegrid: false,
                imgpath: ''
            }).jqGrid('navGrid', '#pager', { edit: false, add: false, del: true, refresh: true, search: true }, {}, {}, { url: "Delete" });
        });

        function EditLinkFormatter(cellvalue, options, rowObject) {
            return '<a href=Edit/' + rowObject[0] + ' >' + cellvalue + '</a>'
        }

    </script>

    <table id="list"><tr><td/></tr></table>
    <div id="pager"></div>